export default (initialState: API.UserInfo) => {
  // 在这里按照初始化数据定义项目中的权限，统一管理
  // 参考文档 https://umijs.org/docs/max/access
  // console.log("initialState>>>", initialState)

  let permissions = initialState?.currentUser?.permissions ?? [];
  if (initialState?.currentUser?.role?.includes('crew')) {
    permissions = []
  }
  const access: any = {};
  if (Array.isArray(permissions)) {
    permissions.forEach((item) => {
      access[item] = true;
    });
  }
  return access as Record<any, boolean>;
};
